/**
 * Created by zby on 2018/3/25.
 */
public class Test3_4_1 {
    public static void main(String[] args) {
        System.out.println("求1！+2！+……+10！");
        int sum = 0;
        for (int j = 1; j < 11; j++) {
            sum = sum + fact(j);
        }
        System.out.println("求1！+2！+……+10！的值为" + sum);

    }

    public static int fact(int n) {
        if (n == 0L)
            return 1;
        else
            return n * fact(n - 1);
    }
}
